﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using L = Science.Mathematics.LinearAlgebra;

namespace Strang3Ed.Chapter02.Section1
{
    public class ExampleB
    {
        public ExampleB()
        {
        }
        private string result;
        public string Result
        {
            get { return result; }
        }
        public void Compute()
        {
            L.Vector v1 = new L.Vector(3);
            v1[0] = 1.0;
            v1[1] = 1.0;
            v1[2] = 2.0;

            L.Vector v2 = new L.Vector(3);
            v2[0] = 3.0;
            v2[1] = 2.0;
            v2[2] = 5.0;

            L.Vector v3 = new L.Vector(3);
            v3[0] = 5.0;
            v3[1] = -3.0;
            v3[2] = 2.0;

            L.Vector b = new L.Vector(3);
            b[0] = 4.0;
            b[1] = 5.0;
            b[2] = 8.0;

            L.Vector y = new L.Vector(3);
            y[0] = 1.0;
            y[1] = 1.0;
            y[2] = -1.0;

            result += (y * v1).ToString() + "\r\n";
            result += (y * v2).ToString() + "\r\n";
            result += (y * v3).ToString() + "\r\n" + "\r\n";
            result += (y * b).ToString() + "\r\n";          
        }
    }
}
/*
0
0
0

1
*/
